package com.rfid.emergencywarehouse.adapter;

import com.rfid.emergencywarehouse.R;
import com.rfid.emergencywarehouse.entity.BarcodeInfo;

import java.util.List;

public class GetAssetAdapter  extends MutilChoiceScanBarCodeAdapter{

    public GetAssetAdapter(List<BarcodeInfo> data) {
        super(data);
    }

    @Override
    protected void bindView(MyHolder holder, int position, BarcodeInfo barcodeInfo) {
        super.bindView(holder, position, barcodeInfo);
        holder.barcode.setText("RFID编码：" + barcodeInfo.getBarcode());
        holder.model.setText("类型：" + barcodeInfo.getSkuModel());
        holder.name.setText("名称：" + barcodeInfo.getMaterialName());
        holder.kw.setText("库位：" + barcodeInfo.getSkuModel());
        if (!barcodeInfo.isEnable()) {
            holder.status.setText("状态：不可用");
        } else {
            holder.status.setText("状态：" + (barcodeInfo.isOutSide()?"已领用":"可领用"));
        }
    }

    @Override
    protected boolean canSelect(BarcodeInfo barcodeInfo) {
        return !barcodeInfo.isOutSide()&&barcodeInfo.isEnable();
    }

    @Override
    protected int getLayout() {
        return R.layout.item_get_asset;
    }
}
